home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / mlibv22.zip / MANUAL.DOC < prev    next >
Text File  |  1993-01-27  |  67KB  |  1,809 lines

  1.  
  2.  
  3.  
  4.  
  5.                                       
  6.                                       
  7.                                       
  8.                                       
  9.                                       
  10.                                       
  11.                                       
  12.                                       
  13.                                       
  14.                                       
  15.                                       
  16.                                       
  17.                                       
  18.                        ***************************************                
  19.                        *                                     *
  20.                        *              MLIB v2.2              *
  21.                        *                                     *
  22.                        *    Mouse library for  QuickBASIC    *
  23.                        *                                     *
  24.                        *                 4.x                 *
  25.                        *                                     *
  26.                        *     and Visual Basic for MS-DOS     *
  27.                        *                                     *
  28.                        *                                     *
  29.                        *    Copyright (c) 1993 TERRY VENN    *
  30.                        *                                     *
  31.                        *          All Rights Reserved        *
  32.                        *                                     *
  33.                        ***************************************
  34.  
  35.  
  36.  
  37.  
  38.                                       MLIB v2.2
  39.                          
  40.                             Copyright (c) 1993 TERRY VENN
  41.         
  42.                                   Shareware Version 
  43.                            
  44.  
  45.         MLIB v2.2  is a library  containing  mouse  procedures  for use  with 
  46.         QuickBASIC v4.x and Visual Basic for MS-DOS.
  47.  
  48.         With a few restrictions, the UNREGISTERED VERSION of  MLIB may freely 
  49.         be copied  and distributed directly  or electronically as a  complete 
  50.         package  only  and because it is  copyright  protected,  it cannot be 
  51.         altered or modified in any way. You, the USER, after determining  the  
  52.         product does have value, and wish to continue using it, are obligated 
  53.         to purchase the registered version.Having done this, you will receive 
  54.         the  current  and complete  copy of  MLIB  along with its  additional 
  55.         features.
  56.  
  57.         As a REGISTERED  USER, you may modify the REGISTERED  VERSION of this 
  58.         library in any way you wish for the sole creation of executable files
  59.         for your  own use or for  sale for a  profit.  IN NO WAY  shall  this 
  60.         library in whole or in part be modified to be distributed or sold for 
  61.         profit where a person other than the LICENSED REGISTERED USER of MLIB 
  62.         can have direct access to these procedures.  The license  to use this
  63.         library may be transferred to a third party if all existing copies of
  64.         this software are also transferred.
  65.  
  66.         I WILL NOT BE  HELD RESPONSIBLE  IN ANY WAY FOR ANY UNDESIRED RESULTS 
  67.         CAUSED BY THE USE, MISUSE, OR INABILITY TO USE MLIB.  If you run into 
  68.         a problem,  regardless of whether  you are a  registered USER or not, 
  69.         please contact  me via direct mail ( address is on the order form) or 
  70.         phone 1-306-379-4505, and I will do my best to rectify the problem.If 
  71.         a response is in order please send a SASE.  
  72.  
  73.         The fee for registering MLIB v2.2 is $20 US / $25 CDN, and includes a
  74.         'registered' copy of  MLIB v2.2  on disk.  The fee covers the cost of
  75.         diskette(s), taxes, shipping and handling.
  76.  
  77.         Payment must be in the  form of cheque or money order.  All US dollar 
  78.         cheques must be drawn on a US bank,  and all  CDN dollar cheques must 
  79.         be drawn on a  Canadian  bank.  There will be a  delay in  processing 
  80.         orders for a non-certified cheque clearance.
  81.  
  82.         To place an order,  please use the order form  contained  in the file 
  83.         ORDER.FRM.  To produce a hard copy of this file on  your printer type 
  84.         the following: A:>COPY ORDER.FRM PRN
  85.  
  86.         IBM  is a  Registered  Trademark of  International  Business  Machine 
  87.         Corporation. 
  88.         
  89.         Microsoft,  MS,  and  MS-DOS are  Registered Trademarks of  Microsoft 
  90.         Corporation. QuickBASIC and Visual Basic are Trademarks of  Microsoft 
  91.         Corporation.
  92.  
  93.  
  94.                               
  95.                               
  96.                               
  97.                               
  98.                               
  99.                               TABLE OF CONTENTS              
  100.  
  101.  
  102.  
  103.  
  104.                 Miscellaneous.
  105.                 ==========================================
  106.  
  107.                 Included with registered version .....  1
  108.                 Getting started ......................  2
  109.                 Shapes contained in library ..........  3
  110.                 
  111.                 ------------------------------------------
  112.                                                         
  113.                         
  114.                 Assembly Routines.                     
  115.                 ==========================================
  116.                 
  117.                 ChangePointer ........................  4
  118.                 DClicBut .............................  5
  119.                 DClicM ...............................  6
  120.                 DClicOff .............................  7
  121.                 DClicOn ..............................  8
  122.                 DClicRate ............................  9
  123.                 GetButtonM ...........................  10
  124.                 GetMotionM ...........................  11
  125.                 GetPressM ............................  12
  126.                 GetReleaseM ..........................  13
  127.                 GetSizeM .............................  14
  128.                 GetSpeedM ............................  15
  129.                 HidePointer ..........................  16
  130.                 InitPointer ..........................  17
  131.                 InWinM ...............................  18
  132.                 RestoreStateM ........................  19
  133.                 SaveStateM ...........................  20
  134.                 SetBoundM ............................  21
  135.                 SetHLimitM ...........................  22
  136.                 SetPointer ...........................  23
  137.                 SetSpeedM ............................  24
  138.                 SetVLimitM ...........................  25
  139.                 ShowPointer ..........................  26
  140.                 ShowPtrM .............................  27
  141.                 
  142.                 ------------------------------------------
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.        
  158.  
  159.        
  160.        
  161.         Included with registered version:
  162.         ---------------------------------------------------------------------
  163.  
  164.         MANUAL.DOC - Documentation.
  165.                 
  166.         MLIB  .INC - Include file.
  167.         
  168.         MLIBN .QLB - Quick library.
  169.                 
  170.         MLIBN .LIB - Linking library (near string support).
  171.         
  172.         MLIBF .LIB - Linking library (far string support).
  173.                
  174.         ME    .EXE - An easy to use  mouse shape  editing  tool.  It's like a
  175.                      simple paint program, where you use the mouse pointer to
  176.                      draw a  picture of the  pointer shape on a grid,  select
  177.                      different colors (three of them "WOW!"), click where the
  178.                      hot spot will be, then save it to a SHAPE.SHP file.
  179.                 
  180.                      NOTE:  ME.EXE requires VGA.
  181.                
  182.         CVTASM.EXE - If  you  have a  MASM  compatible  assembler,   use this
  183.                      command  line  utility  to  read a  SHAPE.SHP  file  and
  184.                      place  the  shape  data  along  with a  CALLname  in  an
  185.                      assembly  text file,  which can  then be  assembled  and
  186.                      added  to  MLIB.  Then  your  program  will be  able  to
  187.                      directly  call this  procedure  to  change  the  pointer
  188.                      shape.
  189.                 
  190.         ASC2SHP.BAS- If you do not have VGA  then use this program to  create 
  191.                      your own pointer shapes (runs in text mode).
  192.        
  193.         SHP2ASC.BAS- Extracts a bit mask from a ???.SHP file, and saves it as
  194.                      a text file for editing (for use with ASC2SHP.BAS).
  195.                 
  196.         OBJ  FILES - All the  object  files that  make up  this  library  are
  197.                      included  ( plus a couple of bit related functions  used 
  198.                      by  SHP2ASC.BAS and  ASC2SHP.BAS) for  your  convenience  
  199.                      in creating your own customized version of this library.
  200.  
  201.                      Please  NOTE!  These  customized  libraries  may  not be
  202.                                     distributed in any way, they are for your 
  203.                                     personal use only!
  204.  
  205.         
  206.         NOT included with registered version:
  207.  
  208.                      There will  NOT  be any "MLIB" copyright notices  in the 
  209.                      library or in any executable files linked with MLIB.LIB.
  210.         
  211.         ---------------------------------------------------------------------
  212.  
  213.                                                            
  214.                                                            
  215.                                                            Page 1
  216.  
  217.  
  218.  
  219.        
  220.  
  221.        
  222.        
  223.         Getting started.
  224.         ---------------------------------------------------------------------
  225.         
  226.         (1): You must have an IBM PC/XT/AT/386 or compatible,  plus Microsoft 
  227.              QuickBASIC 4.x or Visual Basic for MS-DOS.
  228.         
  229.         (2): To use MLIB in the QuickBASIC environment simply type QB/L MLIBN
  230.          
  231.         
  232.         IMPORTANT!
  233.         ==========
  234.         
  235.              All of the examples in this  manual are based on  QuickBASIC 4.5
  236.              (which uses near strings), so if you require far string support,
  237.              make a QUICK library by linking with MLIBF.LIB.
  238.              
  239.              The "N" appended to  MLIB identifies it as a near string library
  240.              and the "F" identifies it as a far string library.
  241.              
  242.              MLIBN.LIB supports near strings ONLY!
  243.              
  244.              MLIBF.LIB supports far strings ONLY!
  245.              
  246.              To create a  QUICK library for your particular  version of BASIC 
  247.              do the following:
  248.  
  249.              If using BASIC 7.x type:
  250.                
  251.                 LINK /Q MLIBF.LIB, MLIBF.QLB, NUL, QBXQLB.LIB;
  252.                
  253.                 Start BASIC 7.x along with MLIB ie., QBX/L MLIBF
  254.              
  255.              If using Visual Basic for MS-DOS type:
  256.                
  257.                 LINK /Q MLIBF.LIB, MLIBF.QLB, NUL, VBDOSQLB.LIB;
  258.                
  259.                 Start VBDOS along with MLIB ie., VBDOS/L MLIBF
  260.         
  261.         (3): For proper operation  always use the line  '$INCLUDE: 'MLIB.INC'
  262.              at the beginning of your program.
  263.  
  264.         (4): After the SCREEN mode has been set, CALL InitPointer(Num%), this
  265.              will initialize the mouse driver plus  MLIB  for this particular
  266.              mode.
  267.  
  268.         (5): All the routines in MLIB are ready to be used. Your program can
  269.              safely call any of these routines whether a mouse is present or
  270.              not.
  271.         
  272.         ---------------------------------------------------------------------
  273.  
  274.                                                            
  275.                                                            
  276.                                                                        
  277.                                                            Page 2
  278.  
  279.  
  280.        
  281.  
  282.        
  283.        
  284.         Pointer shapes contained in library MLIB.
  285.         ---------------------------------------------------------------------
  286.  
  287.         Change the shape of the mouse pointer (graphics mode only).
  288.        
  289.         DECLARE SUB  <shape name>
  290.         
  291.         syntax: CALL <shape name>
  292.         
  293.                 ARROW0
  294.                 HANDV0
  295.                 HOURGLASS0
  296.                 PEN0
  297.                 MAGNIFYGLASS0
  298.                 PAINTCUP0
  299.                 MOUSE0
  300.                 WHATCH0
  301.                 ARROW1
  302.                 
  303.         Example:
  304.           
  305.                 CALL HANDV0 'Change pointer to a hand shape.
  306.         
  307.         
  308.         Comments:
  309.  
  310.                 A zero appended to a shape name denotes a color pointer, A
  311.                 one(1) denotes inverted or non colored pointer.
  312.                 
  313.                 With the registered version you will be able to add new
  314.                 shapes with  CVTASM.EXE  (if you have a MASM compatible 
  315.                 assembler) or delete existing shapes from the library.
  316.  
  317.                 For a working example see: DEMO4.BAS
  318.        
  319.         ---------------------------------------------------------------------
  320.                                                       Assembly subroutine.
  321.        
  322.        
  323.                                                           
  324.                                                           
  325.                                                           
  326.                                                           
  327.                                                            
  328.                                                            
  329.                                                            
  330.                                                            
  331.                                                            
  332.                                                            
  333.                                                            
  334.                                                            
  335.                                                            
  336.                                                            
  337.                                                            
  338.                                                            Page 3
  339.  
  340.  
  341.       
  342.  
  343.       
  344.       
  345.         ChangePointer                                            
  346.         ---------------------------------------------------------------------
  347.  
  348.         Change the shape of the mouse pointer (graphic mode only).
  349.       
  350.         DECLARE SUB ChangePointer(Shape$, HotX%, HotY%)
  351.  
  352.         Syntax: CALL   ChangePointer(Shape$, HotX%, HotY%)
  353.               
  354.                 Shape$ A 64 byte string, consisting of two 32 byte  sections.
  355.                        The first 32 bytes is the  screen mask  which is ANDed
  356.                        on the  screen.  The last half  containing the  cursor
  357.                        mask is then  XORed over this.  A color cursor (SOLID)
  358.                        can have two colors, white or black, where a non color
  359.                        cursor (TRANS) just inverts with the colored pixels it
  360.                        passes over.
  361.                       
  362.                 HotX%  Horizontal hot spot value ranging from 0 - 15.
  363.               
  364.                 HotY%  Vertical hot spot value ranging from 0 - 15.
  365.  
  366.  
  367.         Example:
  368.          
  369.                 HotX% = 0 
  370.                                     ' Upper left corner of new image
  371.                 HotY% = 0
  372.  
  373.                 Shape$ = ArrowHead$ ' String containing the bit image.
  374.  
  375.                 CALL ChangePointer(Shape$, HotX%, HotY%)
  376.                                           
  377.       
  378.         Comments:
  379.  
  380.                 The mouse driver  uses the hot spot  coordinates to determine 
  381.                 the location of the pointer.
  382.       
  383.                 For a working example see: VIEWSHP.BAS
  384.       
  385.         ---------------------------------------------------------------------
  386.                                                       Assembly subroutine.
  387.       
  388.       
  389.       
  390.       
  391.  
  392.                                                          
  393.                                                          
  394.                                                          
  395.                                                          
  396.                                                           
  397.                                                           
  398.                                                           
  399.                                                            Page 4
  400.  
  401.  
  402.         
  403.  
  404.         
  405.         
  406.         DClicBut
  407.         ---------------------------------------------------------------------
  408.  
  409.         Define which button DClicM will check for a double click event.
  410.  
  411.         Use in conjunction with: DClicM
  412.  
  413.         DEFINE SUB DClicBut(ButtonNum%)
  414.  
  415.         Syntax: CALL DClicBut(ButtonNum%)
  416.                 
  417.                 ButtonNum%  Tells DClicM which button to check. A value of 1; 
  418.                             DClicM will check the left  mouse button, a value 
  419.                             of 2,  the right  button will be  checked,  etc., 
  420.                             depending  on the number of buttons the mouse may
  421.                             have.
  422.         
  423.                 
  424.         Example:
  425.                 
  426.                 CALL DClicRate(9) 'Speed  at  which  DClicM  will  register a 
  427.                                   'double click. There are 18 clock ticks per 
  428.                                   'second.  The user  has  1/2 sec. to double 
  429.                                   'click.
  430.                 CALL DClicBut(1)  'DClicM will check the left mouse button.
  431.  
  432.                 DO
  433.                 
  434.                  CALL DClicM(ButtonNum%, X%, Y%, DClik%)
  435.  
  436.                  IF DClik% THEN CALL DClikHandler(ButtonNum%, X%, Y%)
  437.                 
  438.                 LOOP
  439.  
  440.         Comments:
  441.  
  442.         
  443.                 For a working example see: DEMO1.BAS
  444.         
  445.         ---------------------------------------------------------------------
  446.                                                       Assembly Subroutine.
  447.         
  448.         
  449.         
  450.         
  451.         See also:
  452.  
  453.                  DClicM, DClicRate, DClicOn, DClicOff
  454.  
  455.  
  456.                                                            
  457.                                                            
  458.                                                            
  459.                                                            
  460.                                                            Page 5
  461.  
  462.  
  463.  
  464.         
  465.  
  466.         
  467.         
  468.         DClicM
  469.         ---------------------------------------------------------------------
  470.  
  471.         Poll for a mouse double click event.
  472.  
  473.         Use in conjunction with: DClicBut, DClicRate, DClicOn, DClicOff
  474.  
  475.         DECLARE SUB DClicM(ButtonNum%, X%, Y%, DClik%)
  476.  
  477.         Syntax: CALL DClicM(ButtonNum%, X%, Y%, DClik%)
  478.                 
  479.                 ButtonNum% Returns which button is currently depressed. In
  480.                            the case that a double click has occurred, then 
  481.                            ButtonNum% will return the mouse button used to 
  482.                            activate the double click. 1 for the left mouse  
  483.                            button, 2 for the right button, etc.
  484.  
  485.                 X%, Y%     Current  location of the mouse  pointer in pixels.
  486.                            In the case that a double click has occurred, then 
  487.                            X% and Y% will return the  location of the pointer
  488.                            when the event occurred, not the present location.
  489.  
  490.                 DClik%     Returns a -1 if a double click has occurred, else
  491.                            a 0.
  492.         Example:
  493.            
  494.                 CALL DClicRate(9) 'Speed  at  which  DClicM  will  register a 
  495.                                   'double click. There are 18 clock ticks per 
  496.                                   'second.
  497.                                             
  498.                 CALL DClicBut(1) 'Tell DClicM to check the left mouse button.
  499.  
  500.                 DO
  501.                 
  502.                    CALL DClicM(ButtonNum%, X%, Y%, DClik%)
  503.  
  504.                    IF DClik% THEN CALL DClikHandler(ButtonNum%, X%, Y%)
  505.                 
  506.                 LOOP
  507.  
  508.         Comments:
  509.  
  510.                 This subroutine returns the  same  information as  GetButtonM
  511.                 if double click checking is turned off. 
  512.                 
  513.                 For a working example see: DEMO1.BAS
  514.         
  515.         ---------------------------------------------------------------------
  516.                                                       Assembly Subroutine.
  517.         
  518.         See also:
  519.  
  520.                  DClicBut, DClicRate, DClicOn, DClicOff
  521.                                                            
  522.                                                            Page 6
  523.  
  524.  
  525.         
  526.  
  527.         
  528.         
  529.         DClicOff
  530.         ---------------------------------------------------------------------
  531.  
  532.         Turn double click off.
  533.  
  534.         Use in conjunction with: DClicM
  535.         
  536.         DECLARE SUB DClicOff
  537.  
  538.         Syntax: CALL DClicOff
  539.                 
  540.                 Default is on.
  541.  
  542.         Example:
  543.            
  544.                 CALL DClicRate(9) 'Speed  at  which  DClicM  will  register a 
  545.                                   'double click. There are 18 clock ticks per 
  546.                                   'second.  The user has  1/2 sec. to  double 
  547.                                   'click.
  548.                 CALL DClicBut(1)  'DClicM will check the left mouse button.
  549.  
  550.                 CALL DClicOn      'Turn on double click checking.
  551.  
  552.                 DO
  553.                 
  554.                    CALL DClicM(ButtonNum%, X%, Y%, DClik%)
  555.  
  556.                    IF DClik% THEN 
  557.                     
  558.                        CALL DClicOff   'Turn off double click checking.
  559.  
  560.                        CALL MyHandler(ButtonNum%, X%, Y%)
  561.                  
  562.                        EXIT DO
  563.  
  564.                     END IF
  565.                 
  566.                 LOOP
  567.  
  568.         Comments:
  569.  
  570.                 If double click is turned off, then the information  returned 
  571.                 by  DClicM  will be  exactly the  same as what the subroutine 
  572.                 GetButtonM will return.
  573.                 
  574.         ---------------------------------------------------------------------
  575.                                                       Assembly Subroutine.
  576.         
  577.         See also:
  578.  
  579.                  DClicM, DClicBut, DClicRate, DClicOn
  580.  
  581.                                                            
  582.                                                            
  583.                                                            Page 7
  584.  
  585.  
  586.         
  587.  
  588.         
  589.         
  590.         DClicOn
  591.         ---------------------------------------------------------------------
  592.  
  593.         Turn double click on.
  594.  
  595.         Use in conjunction with: DClicM
  596.         
  597.         DECLARE SUB DClicOn
  598.  
  599.         Syntax: CALL DClicOn
  600.                 
  601.                 Default is on.
  602.  
  603.         Example:
  604.            
  605.                 CALL DClicRate(9) 'Speed at  which  DClicM  will  register  a 
  606.                                   'double click. There are 18 clock ticks per 
  607.                                   'second. The  user  has 1/2 sec. to  double 
  608.                                   'click.
  609.                 CALL DClicBut(1)  'DClicM will check the left mouse button.
  610.  
  611.                 CALL DClicOn      'Turn on double click checking.
  612.  
  613.                 DO
  614.                 
  615.                    CALL DClicM(ButtonNum%, X%, Y%, DClik%)
  616.  
  617.                    IF DClik% THEN CALL DClikHandler(ButtonNum%, X%, Y%)
  618.                 
  619.                 LOOP
  620.  
  621.                 
  622.         Comments:
  623.  
  624.                 If double click  is turned off by calling the  subroutine 
  625.                 DClicOff, then the information returned by DClicM will be 
  626.                 exactly the same as what the subroutine  GetButtonM  will 
  627.                 return.
  628.  
  629.         
  630.                 For a working example see: DEMO1.BAS
  631.         
  632.         ---------------------------------------------------------------------
  633.                                                       Assembly Subroutine.
  634.         
  635.         
  636.         
  637.         
  638.         See also:
  639.  
  640.                  DClicM, DClicBut, DClicRate, DClicOff
  641.  
  642.                                                            
  643.                                                            
  644.                                                            Page 8
  645.  
  646.  
  647.  
  648.         
  649.  
  650.         
  651.         
  652.         DClicRate
  653.         ---------------------------------------------------------------------
  654.  
  655.         Set the double click speed.
  656.  
  657.         Use in conjunction with: DClicM
  658.  
  659.         DECLARE SUB DClicRate(Rate%)
  660.  
  661.         Syntax: CALL DClicRate(Rate%)
  662.                 
  663.                 Rate%  The speed at which DClicM will detect a double click.
  664.                        
  665.                        There are 18 clock ticks per second. Default is 9, 
  666.                        or a 1/2 second.
  667.         
  668.         Example:
  669.            
  670.                 CALL DClicRate(9) 'Speed  at  which  DClicM  will  register a 
  671.                                   'double click. There are 18 clock ticks per 
  672.                                   'second.  The user  has  1/2 sec. to double 
  673.                                   'click.
  674.                 CALL DClicBut(1) 'Tell DClicM to check the left mouse button.
  675.  
  676.                 DO
  677.                 
  678.                    CALL DClicM(ButtonNum%, X%, Y%, DClik%)
  679.  
  680.                    IF DClik% THEN CALL DClikHandler(ButtonNum%, X%, Y%)
  681.                 
  682.                 LOOP
  683.  
  684.         Comments:
  685.  
  686.         
  687.                 For a working example see: DEMO1.BAS
  688.         
  689.         ---------------------------------------------------------------------
  690.                                                       Assembly Subroutine.
  691.         
  692.         
  693.         
  694.         
  695.         See also:
  696.  
  697.                  DClicM, DClicBut, DClicOn, DClicOff
  698.  
  699.                                                            
  700.                                                            
  701.                                                            
  702.                                                            
  703.                                                            
  704.                                                            
  705.                                                            
  706.                                                            Page 9
  707.  
  708.  
  709.  
  710.       
  711.  
  712.       
  713.       
  714.         GetButtonM
  715.         ---------------------------------------------------------------------
  716.  
  717.         Check for a mouse button press and get the current mouse pointer
  718.         location.
  719.       
  720.         DECLARE SUB GetButtonM(ButtonNum%, X%, Y%)
  721.       
  722.         Syntax: CALL GetButtonM(ButtonNum%, X%, Y%)
  723.               
  724.                 ButtonNum%  Returns a value of 1,2 or 3 etc,  depending  on
  725.                             which button was pressed and also the number of
  726.                             buttons the mouse may have.
  727.       
  728.                 X%, Y%      Returns the present location of the mouse pointer
  729.                             in pixels.  This location  refers to the  virtual
  730.                             mouse screen coordinates, NOT to the text screen.
  731.                             The upper  left corner of the screen is used as a
  732.                             reference point (0, 0).
  733.         Example:            
  734.                
  735.                 SCREEN 0    'Convert the virtual mouse screen coordinates
  736.                             'to BASIC's row/column format, in text mode.
  737.                 DO          'Using a character block size of 8 X 8.
  738.  
  739.                    CALL GetButtonM(ButtonNum%, X%, Y%)
  740.                 
  741.                    Row% = (Y% \ 8) + 1
  742.                    Col% = (X% \ 8) + 1
  743.                   
  744.                    LOCATE 1: PRINT Row%; " X "; Col%
  745.                  
  746.                    IF ButtonNum% = 1 THEN 'User pressed the left button.
  747.                 
  748.                    IF ButtonNum% = 2 THEN 'User pressed the right button.
  749.  
  750.                 LOOP UNTIL LEN(INKEY$)
  751.  
  752.         Comments:
  753.  
  754.                 To convert the virtual  mouse screen  coordinates to BASIC's
  755.                 row/column format, you must divide X%(column) and Y%(row) by
  756.                 character block size and add 1 to each of these values.
  757.                
  758.                 For a working example see: DEMO1.BAS
  759.       
  760.         ---------------------------------------------------------------------
  761.                                                       Assembly Subroutine
  762.       
  763.                                                           
  764.                                                           
  765.                                                           
  766.                                                            
  767.                                                            
  768.                                                            Page 10
  769.  
  770.  
  771.  
  772.       
  773.  
  774.       
  775.       
  776.         GetMotionM
  777.         ---------------------------------------------------------------------
  778.  
  779.         To determine which direction the mouse pointer is moving.
  780.  
  781.         DECLARE SUB GetMotionM(X%, Y%)
  782.        
  783.         Syntax: CALL GetMotionM(X%, Y%)
  784.               
  785.                 X%  Returns the horizontal value.
  786.                  
  787.                 Y%  Returns the vertical value.
  788.                
  789.         Example:
  790.                   
  791.                 DO
  792.              
  793.                    CALL GetMotionM(X%, Y%)
  794.                
  795.                    Direction$ = ""
  796.                
  797.                    IF X% > 0 THEN Direction$ = "Right" 'If positive.
  798.                    IF X% < 0 THEN Direction$ = "Left " 'If negative.
  799.                    IF Y% > 0 THEN Direction$ = "Down " 'If positive.
  800.                    IF Y% < 0 THEN Direction$ = "Up   " 'If negative.
  801.                
  802.                    IF LEN(Direction$) THEN
  803.                     
  804.                       LOCATE 5
  805.                     
  806.                       PRINT Direction$
  807.                  
  808.                    END IF
  809.  
  810.                 LOOP UNTIL LEN(INKEY$)
  811.               
  812.         Comments:
  813.  
  814.                 The values returned will range from -32768 to 32768.
  815.                 Positive values shows right or downward movement, and
  816.                 negative values show left or upward movement.
  817.                  
  818.         ---------------------------------------------------------------------
  819.                                                       Assembly Subroutine.
  820.       
  821.       
  822.       
  823.  
  824.                                                           
  825.                                                           
  826.                                                           
  827.                                                            
  828.                                                            
  829.                                                            
  830.                                                            Page 11
  831.  
  832.  
  833.        
  834.  
  835.        
  836.        
  837.         GetPressM
  838.         ---------------------------------------------------------------------
  839.  
  840.         Get button press information for the mouse.
  841.  
  842.         DECLARE SUB GetPressM(ButtonNum%, Stat%, Count%, X%, Y%)
  843.  
  844.         Syntax: CALL GetPressM(ButtonNum%, Stat%, Count%, X%, Y%)
  845.                
  846.                 ButtonNum%   State which mouse button to get information on.
  847.                              A value of 1 equals the left mouse button and 2
  848.                              means the right etc, depending on how many
  849.                              buttons the mouse may have.
  850.        
  851.                 Stat%        Returns which button is currently being pressed.
  852.  
  853.                 Count%       Returns the number of button presses since last
  854.                              called.
  855.  
  856.                 X%, Y%       Returns the location of the mouse pointer when
  857.                              the button was last pressed.
  858.  
  859.         Example:
  860.           
  861.                 ButtonNum% = 1 'Check the left button.
  862.                 
  863.                 CALL GetPressM(ButtonNum%, Stat%, Count%, X%, Y%)
  864.                   
  865.                 IF Count% > 1 THEN CALL MySUB(X%, Y%)
  866.  
  867.         Comments:
  868.  
  869.                 NOTE! The values returned in X%, Y% refer to the location
  870.                 of the pointer WHEN the mouse button was pressed, not the
  871.                 current location. The button count is automatically reset
  872.                 to zero each time this routine is called.
  873.        
  874.         ---------------------------------------------------------------------
  875.                                                       Assembly Subroutine.
  876.        
  877.        
  878.        
  879.        
  880.         See also:
  881.  
  882.                  GetReleaseM
  883.  
  884.                                                           
  885.                                                           
  886.                                                           
  887.                                                           
  888.                                                           
  889.                                                            
  890.                                                            
  891.                                                            Page 12
  892.  
  893.  
  894.       
  895.  
  896.       
  897.       
  898.         GetReleaseM
  899.         ---------------------------------------------------------------------
  900.  
  901.         Get button release information for the mouse.
  902.  
  903.         DECLARE SUB GetReleaseM(ButtonNum%, Stat%, Count%, X%, Y%)
  904.  
  905.         Syntax: CALL GetReleaseM(ButtonNum%, Stat%, Count%, X%, Y%)
  906.               
  907.                 ButtonNum%   State which mouse button to get information on.
  908.                              A value of 1 equals the left mouse button and 2
  909.                              means the right etc, depending on how many
  910.                              buttons the mouse may have.
  911.       
  912.                 Stat%        Returns which button is currently being pressed.
  913.  
  914.                 Count%       Returns the number of button releases since last
  915.                              called.
  916.  
  917.                 X%, Y%       Returns the location of the mouse pointer when
  918.                              the button was last pressed.
  919.  
  920.         Example:
  921.          
  922.                 ButtonNum% = 1 'Check the left button.
  923.                
  924.                 CALL GetReleaseM(ButtonNum%, Stat%, Count%, X%, Y%)
  925.                  
  926.                 IF Count% > 1 THEN CALL MySUB(X%, Y%)
  927.  
  928.         Comments:
  929.  
  930.                 NOTE! The values returned in X%, Y% refer to the location
  931.                 of the pointer WHEN the mouse button was pressed, not the
  932.                 current location. The button count is automatically reset
  933.                 to zero each time this routine is called.
  934.       
  935.         ---------------------------------------------------------------------
  936.                                                       Assembly Subroutine.
  937.       
  938.       
  939.       
  940.       
  941.         See also:
  942.  
  943.                 GetPressM
  944.  
  945.                                                          
  946.                                                          
  947.                                                          
  948.                                                          
  949.                                                          
  950.                                                            
  951.                                                            
  952.                                                            Page 13
  953.  
  954.  
  955.         
  956.  
  957.         
  958.         
  959.         GetSizeM
  960.         ---------------------------------------------------------------------
  961.  
  962.         Get the size the mouse driver's environment.  
  963.  
  964.         Use in conjunction with: ShowPtrM%, SaveStateM
  965.  
  966.         DECLARE FUNCTION GetSizeM%
  967.         
  968.         Syntax: Size% = GetSizeM%
  969.                 
  970.                 Size%   Returns the size of the mouse driver's environment  
  971.                         (in bytes).
  972.  
  973.         Example:
  974.            
  975.                 Size% = GetSizeM%           'Amount of memory  needed to hold 
  976.                                             'the mouse driver's  environment.  
  977.  
  978.                 Buffer$ = SPACE$(Size% * 2) 'Pad buffer with spaces.
  979.                 
  980.                 ErrNum% = ShowPtrM%(Buffer$)
  981.  
  982.                 Buffer$ = ""                'Release memory.
  983.  
  984.         Comments:
  985.  
  986.                 Use this function to determine buffer(s) size needed by both 
  987.                 ShowPtrM% and SaveStateM.
  988.         
  989.                 For a working example see: DEMO3.BAS
  990.  
  991.         ---------------------------------------------------------------------
  992.                                                       Assembly function.
  993.         
  994.         
  995.         
  996.         
  997.         See also:
  998.  
  999.                  ShowPtrM%, RestoreStateM, SaveStateM
  1000.  
  1001.                                                            
  1002.                                                            
  1003.                                                            
  1004.                                                            
  1005.                                                            
  1006.                                                            
  1007.                                                            
  1008.                                                            
  1009.                                                            
  1010.                                                            
  1011.                                                                       
  1012.                                                                       
  1013.                                                            Page 14
  1014.  
  1015.         
  1016.      
  1017.  
  1018.      
  1019.      
  1020.         GetSpeedM
  1021.         ---------------------------------------------------------------------
  1022.  
  1023.         Get the current sensitivity state of the mouse.
  1024.  
  1025.         Use in conjunction with: SetSpeedM
  1026.       
  1027.         DECLARE SUB CALL GetSpeedM(H%, V%, D%)
  1028.  
  1029.         Syntax: CALL GetSpeedM(H%, V%, D%)
  1030.              
  1031.                 H%   Returns the current horizontal value.
  1032.                 
  1033.                 Y%   Returns the current vertical value.
  1034.                 
  1035.                 D%   Returns double speed threshold value.
  1036.  
  1037.         Example:
  1038.         
  1039.                 'Get and save the current sensitivity state of the mouse.
  1040.                 'Upon ending your program, pass these values to the routine
  1041.                 'SetSpeedM, which will restore the settings back to their
  1042.                 'original state.
  1043.             
  1044.                 'Program startup.
  1045.  
  1046.                 CALL GetSpeedM(SaveH%, SaveV%, SaveD%) 'Save old setting.
  1047.                 CALL SetSpeedM(50, 50, 80)             'New setting for your
  1048.                                                        'program's use.
  1049.                 'Program code.
  1050.             
  1051.                 CALL SetSpeedM(SaveH%, SaveV%, SaveD%) 'Restore old setting.
  1052.  
  1053.                 'End of program.
  1054.              
  1055.         Comments:
  1056.  
  1057.                 Mouse sensitivity is defined as how far the pointer moves
  1058.                 per actual movement of the mouse itself. The higher the
  1059.                 values in X%, Y% the greater the sensitivity.
  1060.                 
  1061.                 For a working example see: VIEWSHP.BAS
  1062.      
  1063.         ---------------------------------------------------------------------
  1064.                                                       Assembly Subroutine.
  1065.      
  1066.         
  1067.         See also:
  1068.  
  1069.                  SetSpeedM
  1070.                                                            
  1071.                                                            
  1072.                                                            
  1073.                                                            
  1074.                                                            Page 15
  1075.  
  1076.  
  1077.       
  1078.  
  1079.       
  1080.       
  1081.         HidePointer
  1082.         ---------------------------------------------------------------------
  1083.  
  1084.         Remove the mouse pointer from the screen.
  1085.  
  1086.         Use in conjunction with: ShowPointer
  1087.        
  1088.         DECLARE SUB HidePointer
  1089.        
  1090.         Syntax: CALL HidePointer
  1091.               
  1092.  
  1093.         Example:
  1094.          
  1095.                 CALL HidePointer
  1096.                                           
  1097.                 PRINT "A line of text."
  1098.               
  1099.                 Call ShowPointer
  1100.               
  1101.         Comments:
  1102.  
  1103.                 You  must  turn off the pointer  before doing  any drawing or
  1104.                 printing on the  screen;  this will  prevent the pointer from
  1105.                 being  overwritten.  It should also be  noted that the  mouse
  1106.                 driver  increments a counter each time the pointer is  turned
  1107.                 off,  and decrements that count for each call to turn it back
  1108.                 on.  This count  must equal zero  before the driver will turn
  1109.                 the pointer  back on.  For example;  if HidePointer is called
  1110.                 3 times,  then ShowPointer must also be called 3 times before
  1111.                 the pointer will become visible.
  1112.                
  1113.         ---------------------------------------------------------------------
  1114.                                                       Assembly Subroutine.
  1115.       
  1116.       
  1117.       
  1118.       
  1119.         See also:
  1120.  
  1121.                  ShowPointer, ShowMPtr
  1122.  
  1123.                                                          
  1124.                                                          
  1125.                                                          
  1126.                                                           
  1127.                                                           
  1128.                                                           
  1129.                                                           
  1130.                                                           
  1131.                                                           
  1132.                                                           
  1133.                                                            
  1134.                                                            
  1135.                                                            Page 16
  1136.  
  1137.  
  1138.         
  1139.  
  1140.         
  1141.         
  1142.         InitPointer
  1143.         ---------------------------------------------------------------------
  1144.  
  1145.         Initialize the mouse driver to its default state.
  1146.  
  1147.         DECLARE SUB InitPointer(MouseExist%)
  1148.  
  1149.         Syntax: CALL InitPointer(MouseExist%)
  1150.                 
  1151.                 MouseExist%  Returns with the number of buttons on the mouse, 
  1152.                              if a mouse driver  is detected.  If no driver is 
  1153.                              present, a 0 is returned.
  1154.  
  1155.         
  1156.         Example:
  1157.            
  1158.                 CALL InitPointer(Num%)
  1159.  
  1160.                 IF Num% THEN
  1161.                       
  1162.                    PRINT "This mouse has "; Num%; " buttons."
  1163.                    
  1164.                 ELSE
  1165.                       
  1166.                    PRINT "Unable to detect a mouse driver."
  1167.                    
  1168.                 END IF
  1169.  
  1170.                 
  1171.         Comments:
  1172.  
  1173.                 IMPORTANT! - InitPointer should be called  after any  screen
  1174.                              mode  changes and  MUST  be  initialized before 
  1175.                              calling any other mouse routine!
  1176.  
  1177.                              In  addition to  InitPointer  initializing  the 
  1178.                              mouse  driver's  internal  variables,  it  also 
  1179.                              initializes its own internal variables  used by   
  1180.                              other mouse routines contained in this library.
  1181.  
  1182.  
  1183.                 
  1184.                 Your  program  can safely  call any of these  mouse routines 
  1185.                 whether a mouse driver has been installed or not.
  1186.                              
  1187.         ---------------------------------------------------------------------
  1188.                                                       Assembly Subroutine.
  1189.         
  1190.         
  1191.         
  1192.         
  1193.                                                            
  1194.                                                            
  1195.                                                            
  1196.                                                            Page 17
  1197.  
  1198.  
  1199.         
  1200.  
  1201.         
  1202.         
  1203.         InWinM
  1204.         ---------------------------------------------------------------------
  1205.  
  1206.         Check if pointer is in a specified area on the screen. 
  1207.         
  1208.         DECLARE FUNCTION InWinM(BYVAL x1%, BYVAL y1%, BYVAL x2%, BYVAL y2%)
  1209.  
  1210.         Syntax: InIt% = InWinM(x1%, y1%, x2%, y2%)
  1211.                 
  1212.                 x1%, x2%  Left and right boundaries (in pixels).
  1213.  
  1214.  
  1215.                 y1%, y2%  Top and bottom boundaries (in pixels).
  1216.  
  1217.                 InIt%     Returns a -1 if true, else 0.
  1218.  
  1219.         
  1220.         Example:
  1221.            
  1222.                                                  'Loop until pointer is in an 
  1223.                                                  'area starting in  the upper 
  1224.                                                  'left corner  of the screen, 
  1225.                                                  '100 pixels wide by 100 high.
  1226.                                                  
  1227.                 DO
  1228.  
  1229.                    InIt% = InWinM(0, 0, 100, 100)
  1230.         
  1231.                 LOOP UNTIL InIt%
  1232.  
  1233.  
  1234.  
  1235.         Comments:
  1236.  
  1237.                 BYVAL is used here for speed.             
  1238.                 
  1239.                 NOTE!   This  function will  not work  properly with a screen
  1240.                 resolution of 320 X 200.
  1241.  
  1242.                 For a working example see: DEMO4.BAS
  1243.         
  1244.         ---------------------------------------------------------------------
  1245.                                                       Assembly Function.
  1246.         
  1247.         
  1248.         
  1249.                                                            
  1250.                                                            
  1251.                                                            
  1252.                                                            
  1253.                                                            
  1254.                                                            
  1255.                                                            
  1256.                                                            
  1257.                                                            Page 18
  1258.  
  1259.  
  1260.         
  1261.  
  1262.         
  1263.         
  1264.         RestoreStateM
  1265.         ---------------------------------------------------------------------
  1266.  
  1267.         Restore mouse environment.
  1268.  
  1269.         Use in conjunction with: GetSizeM, SaveStateM
  1270.         
  1271.         DECLARE SUB RestoreStateM(Buff1$, ErrNum%)
  1272.         
  1273.         Syntax: CALL RestoreStateM(Buff1$, ErrNum%)
  1274.                 
  1275.                 Buff1$  Buffer which contains the mouse driver's environment.  
  1276.                         
  1277.  
  1278.                 ErrNum% Returns a -1, if Buff1$ is smaller than the mouse 
  1279.                         environment.
  1280.         
  1281.         
  1282.         Example:
  1283.            
  1284.                 Size% = GetSizeM%                   ' Amount of memory needed to 
  1285.                                                     ' to hold the mouse 
  1286.                                                     ' driver's environment.  
  1287.                 Buff1$ = SPACE$(Size%)              ' Pad buffer with spaces.
  1288.                 
  1289.                 CALL SaveStateM(Buff1$, ErrNum%)    ' Save mouse state.
  1290.  
  1291.                 SHELL"XXXX"                         ' Pass control.
  1292.  
  1293.                 CALL RestoreStateM(Buff1$, ErrNum%) ' Restore state.
  1294.  
  1295.         Comments:
  1296.  
  1297.                 Use this subroutine to restore the mouse environment after
  1298.                 it has been saved by SaveStateM.
  1299.                 
  1300.                 For a working example see: DEMO3.BAS
  1301.  
  1302.         ---------------------------------------------------------------------
  1303.                                                       Assembly subroutine.
  1304.         
  1305.         
  1306.         
  1307.         
  1308.         See also:
  1309.  
  1310.                  GetSizeM, SaveStateM 
  1311.  
  1312.                                                            
  1313.                                                            
  1314.                                                            
  1315.                                                            
  1316.                                                            
  1317.                                                            
  1318.                                                            Page 19
  1319.  
  1320.  
  1321.         
  1322.  
  1323.         
  1324.         
  1325.         SaveStateM
  1326.         ---------------------------------------------------------------------
  1327.  
  1328.         Save the mouse driver's environment in a buffer.
  1329.  
  1330.         Use in conjunction with: GetSizeM, RestoreStateM
  1331.  
  1332.         DECLARE SUB SaveStateM(Buff1$, ErrNum%)
  1333.         
  1334.         Syntax: CALL SaveStateM(Buff1$, ErrNum%)
  1335.                 
  1336.                 Buff1$   Buffer in which the mouse driver's environment  
  1337.                          will be saved.  
  1338.  
  1339.                 ErrNum%  Returns a -1, if Buff1$ is not large enough to hold 
  1340.                          the mouse environment.
  1341.         
  1342.         
  1343.         Example:
  1344.            
  1345.                 Size% = GetSizeM%                   ' Amount of memory needed to 
  1346.                                                     ' to hold the mouse 
  1347.                                                     ' driver's environment.  
  1348.                 Buff1$ = SPACE$(Size%)              ' Pad buffer with spaces.
  1349.                 
  1350.                 CALL SaveStateM(Buff1$, ErrNum%)    ' Save mouse state.
  1351.  
  1352.                 SHELL"XXXX"                         ' Pass control.
  1353.  
  1354.                 CALL RestoreStateM(Buff1$, ErrNum%) ' Restore state.
  1355.  
  1356.         Comments:
  1357.  
  1358.                 If your program needs to temporarily pass control to another
  1359.                 program or procedure that also uses the mouse and where the 
  1360.                 mouse state may be altered (such as a video mode change), use 
  1361.                 GetSizeM along with this subroutine, to save the mouse state
  1362.                 first before passing control. When your program has regained
  1363.                 control, use RestoreStateM to restore the driver's state.
  1364.                 
  1365.                 For a working example see: DEMO3.BAS
  1366.  
  1367.         ---------------------------------------------------------------------
  1368.                                                       Assembly subroutine.
  1369.         
  1370.         
  1371.         
  1372.         
  1373.         See also:
  1374.  
  1375.                  GetSizeM, RestoreStateM 
  1376.  
  1377.                                                            
  1378.                                                            
  1379.                                                            Page 20
  1380.  
  1381.  
  1382.         
  1383.  
  1384.         
  1385.         
  1386.         SetBoundM
  1387.         ---------------------------------------------------------------------
  1388.  
  1389.         Confine pointer movement to a specified area on the screen.
  1390.  
  1391.         DECLARE SUB SetBoundM(x1%, y1%, x2%, y2%)
  1392.  
  1393.         Syntax: CALL SetBoundM(x1%, y1%, x2%, y2%)
  1394.                 
  1395.                 x1%, x2%  Left and right boundaries (in pixels).
  1396.                 
  1397.                 y1%, y2%  Top and bottom boundaries (in pixels).
  1398.         
  1399.         Example:
  1400.            
  1401.                                                  'Limit pointer  to an  area
  1402.                                                  'starting in the upper left
  1403.                                                  'corner of the screen,  100
  1404.                                                  'pixels wide by 100  pixels 
  1405.                                                  'high.
  1406.                 CALL SetBoundM(0, 0, 100, 100)
  1407.                 
  1408.         Comments:
  1409.  
  1410.                              
  1411.                 SetBoundM does the same thing as calling both SetHLimitM and
  1412.                 SetVLimitM, but does it with only one call. 
  1413.         
  1414.                 For a working example see: DEMO4.BAS
  1415.         
  1416.         ---------------------------------------------------------------------
  1417.                                                       Assembly Subroutine.
  1418.         
  1419.         
  1420.         
  1421.         See also:
  1422.                  
  1423.                 SetHLimitM, SetVLimitM.                                                   
  1424.                                                            
  1425.                                                            
  1426.                                                            
  1427.                                                            
  1428.                                                            
  1429.                                                            
  1430.                                                            
  1431.                                                            
  1432.                                                            
  1433.                                                            
  1434.                                                            
  1435.                                                            
  1436.                                                            
  1437.                                                            
  1438.                                                            
  1439.                                                            
  1440.                                                            Page 21
  1441.  
  1442.  
  1443.  
  1444.     
  1445.  
  1446.     
  1447.     
  1448.         SetHLimitM
  1449.         ---------------------------------------------------------------------
  1450.        
  1451.         Define a left and right boundary in which the horizontal movement of
  1452.         the mouse pointer will be confined to.
  1453.        
  1454.         DECLARE SUB SetHLimitM(X%, Y%)
  1455.       
  1456.         Syntax: CALL SetHLimitM(X%, Y%)
  1457.             
  1458.                 X%   Minimum left limit in pixels.
  1459.                
  1460.                 Y%   Maximum right limit in pixels.
  1461.  
  1462.         Example:
  1463.        
  1464.                 X1% = 0   'Create a window in which the pointer will be
  1465.                 Y1% = 100 'confined to.
  1466.                 X2% = 0  
  1467.                 Y2% = 100
  1468.  
  1469.                 CALL SetHLimitM(X1%, Y1%)
  1470.                
  1471.                 CALL SetVLimitM(X2%, Y2%)
  1472.                                         
  1473.         Comments:
  1474.  
  1475.                 If the left value is greater than the right value, this
  1476.                 routine will exchange the two. The pointer will then be
  1477.                 displayed within these two limits.
  1478.     
  1479.         ---------------------------------------------------------------------
  1480.                                                       Assembly Subroutine.
  1481.     
  1482.     
  1483.     
  1484.     
  1485.         See also:
  1486.  
  1487.                  SetVLimitM
  1488.  
  1489.                                                        
  1490.                                                        
  1491.                                                        
  1492.                                                          
  1493.                                                          
  1494.                                                          
  1495.                                                          
  1496.                                                          
  1497.                                                          
  1498.                                                          
  1499.                                                          
  1500.                                                            
  1501.                                                            
  1502.                                                            Page 22
  1503.  
  1504.  
  1505.         
  1506.  
  1507.         
  1508.         
  1509.         SetPointer
  1510.         ---------------------------------------------------------------------
  1511.  
  1512.         Display the mouse pointer at a new location.
  1513.  
  1514.         DECLARE SUB SetPointer(X%, Y%)
  1515.         
  1516.         Syntax: CALL SetPointer(X%, Y%)
  1517.                 
  1518.                 X%   New horizontal position, in pixels.
  1519.  
  1520.                 Y%   New vertical position, in pixels.
  1521.  
  1522.         Example:
  1523.            
  1524.                 X% = 0
  1525.                        'Upper left corner of the screen.
  1526.                 Y% = 0
  1527.                    
  1528.                 CALL SetPointer(X%, Y%)
  1529.  
  1530.                 
  1531.         Comments:
  1532.  
  1533.                 
  1534.                 If X% or Y% are outside of any defined limit, such as off
  1535.                 the screen, the mouse driver will automatically place the
  1536.                 pointer to the nearest legal limit.
  1537.         
  1538.         ---------------------------------------------------------------------
  1539.                                                       Assembly Subroutine.
  1540.         
  1541.         
  1542.  
  1543.                                                            
  1544.                                                            
  1545.                                                            
  1546.                                                            
  1547.                                                            
  1548.                                                            
  1549.                                                            
  1550.                                                            
  1551.                                                            
  1552.                                                            
  1553.                                                            
  1554.                                                            
  1555.                                                            
  1556.                                                            
  1557.                                                            
  1558.                                                            
  1559.                                                            
  1560.                                                            
  1561.                                                            
  1562.                                                            
  1563.                                                            Page 23
  1564.  
  1565.  
  1566.     
  1567.  
  1568.     
  1569.     
  1570.         SetSpeedM
  1571.         ---------------------------------------------------------------------
  1572.  
  1573.         Set the sensitivity state of the mouse.
  1574.  
  1575.         Use in conjunction with: GetSpeedM
  1576.      
  1577.         DECLARE SUB CALL SetSpeedM(H%, V%, D%)
  1578.  
  1579.         Syntax: CALL SetSpeedM(H%, V%, D%)
  1580.             
  1581.                 H%   New horizontal value (1 - 100).
  1582.                
  1583.                 Y%   New vertical value (1 - 100).
  1584.                
  1585.                 D%   New double speed threshold (1 - 100).
  1586.  
  1587.         Example:
  1588.        
  1589.                 'Get and save the current  sensitivity state of the  mouse.
  1590.                 'Upon ending your program, pass these values to the routine
  1591.                 'SetSpeedM,  which will restore the  settings back to their
  1592.                 'original state.
  1593.              
  1594.                 'Program startup.
  1595.                                                         
  1596.                 CALL GetSpeedM(SaveH%, SaveV%, SaveD%) ' Save old setting.
  1597.                 CALL SetSpeedM(50, 50, 80)             ' New setting for your
  1598.                                                        ' program's use.
  1599.                 'Program code.
  1600.              
  1601.                 CALL SetSpeedM(SaveH%, SaveV%, SaveD%) ' Restore setting.
  1602.  
  1603.                 'End of program.
  1604.             
  1605.         Comments:
  1606.  
  1607.                 Mouse sensitivity  is defined as how far the pointer moves
  1608.                 per  actual  movement of the mouse itself.  The higher the
  1609.                 values in X%, Y% the greater the sensitivity.
  1610.     
  1611.                 For a working example see: VIEWSHP.BAS
  1612.     
  1613.         ---------------------------------------------------------------------
  1614.                                                       Assembly Subroutine.
  1615.     
  1616.         
  1617.         See also:
  1618.  
  1619.                  GetSpeedM
  1620.                                                            
  1621.                                                            
  1622.                                                            
  1623.                                                            
  1624.                                                            Page 24
  1625.  
  1626.  
  1627.      
  1628.  
  1629.      
  1630.      
  1631.         SetVLimitM
  1632.         ---------------------------------------------------------------------
  1633.        
  1634.         Define an upper and lower boundary in which the vertical movement of
  1635.         the mouse pointer will be confined to.
  1636.  
  1637.         DECLARE SUB SetVLimitM(X%, Y%)
  1638.        
  1639.         Syntax: CALL SetVLimitM(X%, Y%)
  1640.              
  1641.                 X%   Minimum upper limit in pixels.
  1642.                 
  1643.                 Y%   Maximum lower limit in pixels.
  1644.  
  1645.         Example:
  1646.         
  1647.                 X1% = 0   'Create a window in which the pointer will be
  1648.                 Y1% = 100 'confined to.
  1649.                 X2% = 0  
  1650.                 Y2% = 100
  1651.  
  1652.                 CALL SetHLimitM(X1%, Y1%)
  1653.                
  1654.                 CALL SetVLimitM(X2%, Y2%)
  1655.                                          
  1656.         Comments:
  1657.  
  1658.                 If the upper value is greater than the lower value, this
  1659.                 routine will exchange the two. The pointer will then be
  1660.                 displayed within these two limits.
  1661.      
  1662.         ---------------------------------------------------------------------
  1663.                                                       Assembly Subroutine.
  1664.  
  1665.  
  1666.  
  1667.  
  1668.         See also:
  1669.  
  1670.                  SetHLimitM
  1671.  
  1672.                                                            
  1673.                                                            
  1674.                                                            
  1675.                                                            
  1676.                                                            
  1677.                                                            
  1678.                                                            
  1679.                                                            
  1680.                                                            
  1681.                                                            
  1682.                                                            
  1683.                                                            
  1684.                                                            
  1685.                                                            Page 25
  1686.  
  1687.  
  1688.      
  1689.  
  1690.      
  1691.      
  1692.         ShowPointer
  1693.         ---------------------------------------------------------------------
  1694.  
  1695.         Display the mouse pointer on the screen.
  1696.  
  1697.         Use in conjunction with: HidePointer
  1698.       
  1699.         DECLARE SUB ShowPointer
  1700.       
  1701.         Syntax: CALL ShowPointer
  1702.              
  1703.  
  1704.         Example:
  1705.         
  1706.                 CALL HidePointer
  1707.                                          
  1708.                 PRINT "A line of text."
  1709.              
  1710.                 Call ShowPointer
  1711.              
  1712.         Comments:
  1713.  
  1714.                 You must turn off the  pointer before  doing any  drawing or
  1715.                 printing on the screen;  this will prevent the pointer  from
  1716.                 being overwritten.  It should also be  noted that  the mouse
  1717.                 driver increments a counter each time the pointer is  turned
  1718.                 off, and decrements that count for each call to turn it back
  1719.                 on. This count must  equal zero before the driver will  turn
  1720.                 the pointer back on.  For example;  if HidePointer is called
  1721.                 3 times, then ShowPointer must also be called 3 times before
  1722.                 the pointer will become visible.
  1723.               
  1724.         ---------------------------------------------------------------------
  1725.                                                       Assembly Subroutine.
  1726.      
  1727.      
  1728.      
  1729.      
  1730.         See also:
  1731.  
  1732.                  HidePointer, ShowPtrM
  1733.  
  1734.                                                         
  1735.                                                         
  1736.                                                         
  1737.                                                          
  1738.                                                          
  1739.                                                          
  1740.                                                          
  1741.                                                          
  1742.                                                          
  1743.                                                           
  1744.                                                            
  1745.                                                            
  1746.                                                            Page 26
  1747.  
  1748.  
  1749.         
  1750.  
  1751.         
  1752.         
  1753.         ShowPtrM
  1754.         ---------------------------------------------------------------------
  1755.  
  1756.         Restore the mouse pointer on the screen.
  1757.  
  1758.         Use in conjunction with: GetSizeM
  1759.  
  1760.         DECLARE FUNCTION ShowPtrM%(Buffer$)
  1761.         
  1762.         Syntax: ErrNum% = ShowPtrM%(Buffer$)
  1763.                 
  1764.                 Buffer$   ShowPtrM% needs a working space of at least twice  
  1765.                           the size of the mouse driver's environment.  
  1766.  
  1767.                 ErrNum%   If successful a value of 0 will be returned.
  1768.  
  1769.                           If unsuccessful a value of -1 will be returned
  1770.                           (Buffer$ was of insufficient size).
  1771.                           
  1772.  
  1773.         Example:
  1774.            
  1775.                 Size% = GetSizeM%           'Amount of memory  needed to hold 
  1776.                                             'the mouse driver's  environment.  
  1777.  
  1778.                 Buffer$ = SPACE$(Size% * 2) 'Pad buffer with spaces.
  1779.                 
  1780.                 ErrNum% = ShowPtrM%(Buffer$)
  1781.  
  1782.                 Buffer$ = ""                'Release memory.
  1783.  
  1784.         Comments:
  1785.  
  1786.                 The purpose of this function is to turn the  pointer on (make
  1787.                 it visible), whether it  has been previously  turned off once 
  1788.                 or multiple times.
  1789.                 
  1790.                 NOTE! This function does  take time so use when  speed is not
  1791.                 critical.
  1792.         
  1793.                 For a working example see: DEMO2.BAS
  1794.         
  1795.         ---------------------------------------------------------------------
  1796.                                                       Assembly function.
  1797.         
  1798.         
  1799.         
  1800.         
  1801.         See also:
  1802.  
  1803.                  GetSizeM, ShowPointer
  1804.  
  1805.                                                            
  1806.                                                                       
  1807.                                                            Page 27
  1808.  
  1809.